package com.sxx.beautifulcity.database;

import com.sxx.beautifulcity.entity.greendao.LineDaoEntity;
import com.sxx.beautifulcity.entity.greendao.LineDaoEntityDao;

import java.util.List;

/**
 * Created by dllo on 15/11/2.
 */
public class LineHelper {

    private DaoSingleton instance = DaoSingleton.getInstance();
    private LineDaoEntityDao daoEntityDao;

    public LineHelper() {
        this.daoEntityDao = instance.getLineDao();
    }

    /***
     * 添加数据
     */

    public void saveLineList(List<LineDaoEntity> entityDaos){
        daoEntityDao.insertInTx(entityDaos);
    }
    /**
     * 删除数据
     */
    public void deleteLine(List<LineDaoEntity> daoEntities){
        daoEntityDao.deleteAll();
    }
    /**
     * 查询数据
     */
    public List<LineDaoEntity> queryAllLine(){
        return daoEntityDao.loadAll();
    }

}
